$(function () {
    $("body").on('click','[data-stopPropagation]',function (e) {e.stopPropagation();});
    $('#labelStatic').trigger("click");
});
/**客户数量统计**/
function customeStatis(btn) {
    $.post(ctx+"center/loadSaleCustomer",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
                $("#paneldia").removeClass("height-600");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
                $("#paneldia").addClass("height-600");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {
        $(this).removeClass("liback");
    });
    $("#workFenxi").find("li").each(function () {
        $(this).removeClass("liback");
    });
    $("#phoneFenxi").find("li").each(function () {
        $(this).removeClass("liback");
    });
    $(btn).parent().addClass("liback");
}
/**客户标签变化**/
function customerLabelStatis(btn) {
    $.post(ctx+"center/loadSaleCustomerLabel",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}
/**客户管理**/
function customeManange(btn){
    $.post(ctx+"center/loadSaleCustomerManage",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",  function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
                $("#sale_cusManage").find("tbody").eq(0).css("max-height","270px");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
                $("#sale_cusManage").find("tbody").eq(0).css("max-height","570px");
                $JuXue.refreshTable("sale_cusManage");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}
/**客户创建记录**/
function customerCreate(btn){
    $.post(ctx+"center/loadSaleCustomerCreate",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}
/**推广资源领取记录**/
function exEmpReverCreate(btn){
    $.post(ctx+"center/loadSaleCustomerRece",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}
/**客户转让记录**/
function exEmpReverTrans(btn){
    $.post(ctx+"center/loadSaleCustomerTrans",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}
/**客户转让记录**/
function exEmpFenpeiTrans(btn){
    $.post(ctx+"center/loadSaleCustomerFenpei",{},function (r) {
        $("#selectContent").empty().append(r);
        /**定制化**/
        $("#selectExpand").off("click").on("click",function (a) {
            var ass = $("#expandManage").hasClass("height-full width-full m-0");
            if (ass){
                $("#expandManage").removeClass("height-full width-full m-0");
            }else{
                $("#expandManage").addClass("height-full width-full m-0");
            }
        });
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}



/**今日统计**/
function selectTodyStatic(btn){
    $.post(ctx+"center/loadPhoneRecord",{},function (r) {
        $("#selectContent").empty().append(r);
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}

/**外接电话统计**/
function getConnectphone(btn) {
    $.post(ctx+"center/loadSaleInPhone",{},function (r) {
        $("#selectContent").empty().append(r);
    });
    $("#cusFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#workFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $("#phoneFenxi").find("li").each(function () {$(this).removeClass("liback");});
    $(btn).parent().addClass("liback");
}